import React, { Component } from 'react';
import './App.css';
import {connect} from 'react-redux'
import {increment,incrementAsync,getuser} from './actions/counter.js'




class App extends Component{
  render(){
  return (
    <div className="App">
     
    <p>
        {this.props.counter}
      </p>
      <button onClick={this.props.increment}>+</button>
      <button onClick={this.props.incrementAsync}>async+</button>

      <br></br>
      <button onClick={this.props.getuser}>get user</button>



    </div>
    
  );
}
}

const mapStateToProps = (state) =>{
  return {
    counter:state.counter
  }
}

export default connect(mapStateToProps,{increment,incrementAsync,getuser})(App)
